from kivy.app import App
from kivy.uix.button import Button
from kivy.animation import Animation

class MyApp(App):
    def build(self):
        # 创建一个按钮
        button = Button(text='Animate Me!', size_hint=(None, None), size=(100, 50))
        button.bind(on_press=self.animate_button)
        return button

    def animate_button(self, instance):
        # 创建动画
        animation = Animation(pos=(200, 200), duration=1) + Animation(pos=(100, 100), duration=1)
        animation.start(instance)

if __name__ == '__main__':
    MyApp().run()